﻿<cfsilent>
	<cfscript>

		strAdvice = getProperty("serviceFactory").getBean("stringAdvice");
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		mathAdvice = getProperty("serviceFactory").getBean("senateMathAdvice");

		termId = event.getArg("TermID");
		depId = event.getArg("DepID");
		courseId = event.getArg("CID");
		bookId = event.getArg("BID");
		courseBookId = event.getArg("CBID");
		
		academicYear = event.getArg("AcademicYear");
		academicTerm = event.getArg("AcademicTerm");

		/* 读取征订单项数据 */
		sql = "	SELECT
					cb.plan_student,
					cb.plan_teacher,
					cb.contract,
					cb.telephone
				FROM
					t_course_book cb
				WHERE
					cb.cbid = :courseBookId ";
		
		queryObj = new Query(datasource = application.dnsSlave);
		queryObj.addParam( name ="courseBookId", value=courseBookId, cfsqltype="cf_sql_varchar");
		
		rs_courseBook = queryObj.execute(sql = sql).getResult();

		/* 读取教材信息 */
		sql = "	SELECT
					b.book_name,
					b.book_isbn,
					b.book_authors,
					p.publisher,
					b.book_edition,
					b.book_prise,
					b.book_awards,
					b.book_stock
				FROM
					t_book b INNER JOIN t_publisher p ON p.pid = b.pid
				WHERE
					b.bid = :bookId ";
		
		queryObj = new Query(datasource = application.dnsSlave);
		queryObj.addParam(name = "bookId", value = bookId, cfsqltype = "cf_sql_varchar");
		
		rs_book = queryObj.execute(sql = sql).getResult();
		
		/* 读取使用教材的所有课程 */
		sql = "	SELECT
					c.course_name,c.course_credit,i.institute_name,
					CASE WHEN cb.contract IS NULL THEN '-' ELSE cb.contract END contract,
					CASE WHEN cb.telephone IS NULL THEN '-' ELSE cb.telephone END telephone,
					c.cid,b.bid,cb.cbid
				FROM
					t_course_book cb INNER JOIN t_course c ON cb.cid = c.cid INNER JOIN t_institute i ON c.institute_id = i.institute_id
					INNER JOIN t_book b ON b.bid = cb.bid
				WHERE
					cb.term_id = :termId 
					AND
					b.bid = :bookId 
					AND
					c.cid != :courseId 
				ORDER BY
					c.course_name";

		queryObj = new Query(datasource = application.dnsSlave);
		queryObj.addParam(name = "termId", value = termId, cfsqltype = "cf_sql_char");
		queryObj.addParam(name = "bookId", value = bookId, cfsqltype = "cf_sql_varchar");
		queryObj.addParam(name = "courseId", value = courseId, cfsqltype = "cf_sql_varchar");
		
		rs_courseByBook = queryObj.execute(sql = sql).getResult();

		/* 读取课程信息 */
		sql = "	SELECT
					c.course_name,c.course_credit,c.period_theory,c.period_practice,c.period_computer,i.institute_name,i.institute_short,
					cc.cat_name
				FROM
					t_course c INNER JOIN t_institute i ON i.institute_id = c.institute_id INNER JOIN t_course_catalog cc ON cc.cat_id = c.cat_id
				WHERE
					c.cid = :courseId ";

		queryObj = new Query(datasource = application.dnsSlave);
		queryObj.addParam(name = "courseId", value = courseId, cfsqltype = "cf_sql_varchar");
		
		rs_course = queryObj.execute(sql = sql).getResult();

		/* 读取课程所有教材信息 */
		
		sql = "SELECT 
					 t_book.book_name, t_book.book_authors, t_book.book_edition, 
					 t_publisher.publisher, t_book.book_isbn, 
					 t_course_book.cid, t_book.bid, t_course_book.cbid 
				FROM 
					 t_course_book  
					 INNER JOIN t_book ON t_book.bid = t_course_book.bid 
					 INNER JOIN t_publisher ON t_publisher.pid = t_book.pid 
				WHERE 
					 t_course_book.term_id = :termId 
					 AND 
					 t_course_book.cid = :courseId 
				ORDER BY 
					 t_book.book_name 
					  ";

		queryObj = new Query(datasource = application.dnsSlave);
		queryObj.addParam(name = "courseId", value = courseId, cfsqltype = "cf_sql_varchar");
		queryObj.addParam(name = "termId", value = termId, cfsqltype = "cf_sql_char");
		
		rs_bookForCourse = queryObj.execute(sql = sql).getResult();


		/* 读取任课单位信息 */

		event.setArg("pageTitle", "教材管理 - 教材征订与发放 - 学期征订计划 - " & rs_course.institute_short& " - 课程教材明细");

		currentTab = event.getArg("TabID", "labCourseBook");
		
		targetArgs = structNew();
		
		structInsert(targetArgs, "DepID", depId, true);
		structInsert(targetArgs, "CBID", courseBookId, true);
		
		

	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('bookByDepartment', targetArgs)#</cfoutput>"><i class="mrs img btnPublish"></i><span class="uiButtonText"><cfoutput>#rs_course.institute_name#</cfoutput></span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 application"></i>教材征订计划明细
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">
			
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labCourseBook">class="active"</cfif> id="labCourseBook" tabTarget="CourseBook">征订明细</span>
						<span <cfif currentTab eq "labCourseInfo">class="active"</cfif> id="labCourseInfo" tabTarget="CourseInfo">课程</span>
						<span <cfif currentTab eq "labBookInfo">class="active"</cfif> id="labBookInfo" tabTarget="BookInfo">教材</span>
						<span <cfif currentTab eq "labPlanDelete">class="active"</cfif> id="labPlanDelete" tabTarget="PlanDelete">删除征订信息</span>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					
					// -->
					//]]>
				</script>

				<cfif rs_courseBook.recordCount>
					
					<script language="javascript" type="text/javascript">
						//<![CDATA[
						<!--
						function showCourseBookDelete() {
							
							$("div.tabLables span").removeClass("active");
							$("div.tabLables span#labPlanDelete").addClass("active");

							$("div.tabContent[@id!='PlanDelete']").hide();
							$("div.tabContent#PlanDelete").show();
							
						}
						// -->
						//]]>
					</script>

					<div id="CourseBook" class="tabContent">
						
						<div class="noticeBlock">
							<h3>征订数据明细</h3>
							<p>
								<span class="img icon16x16 edit"></span>
								如该课程教材征订有误, <a href="javascript:showCourseBookDelete();">可以通过点击这里进行删除</a>. 
							</p>
							<hr/>
						</div>
						
						<div class="UIDashBoard clearfix">
							<div class="col2">
								<div class="noticeBlock">
									<h2><cfoutput>#rs_course.course_name#</cfoutput></h2>
									<p>学分 <em><cfoutput>#numberFormat(rs_course.course_credit, "_.__")#</cfoutput></em></p>
									<p>课程学时分布
										<cfif rs_course.period_theory>理论 <em><cfoutput>#rs_course.period_theory#</cfoutput></em></cfif>
										<cfif rs_course.period_practice>实践 <em><cfoutput>#rs_course.period_practice#</cfoutput></em></cfif>
										<cfif rs_course.period_computer>上机 <em><cfoutput>#rs_course.period_computer#</cfoutput></em></cfif>
									</p>
									<ol>
										<li>任课单位: <cfoutput>#rs_course.institute_name#</cfoutput></li>
										<li>类别: <cfoutput>#rs_course.cat_name#</cfoutput></li>
									</ol>
								</div>
							</div>
							<div class="col2 last">
								<div class="noticeBlock">
									<h2>《<cfoutput>#rs_book.book_name#</cfoutput>》</h2>
									<cfif mathAdvice.isISBN( rs_book.book_isbn )>
										<p>
											<em><cfoutput>#dictAdvice.getISBN( rs_book.book_isbn )#</cfoutput></em>
											<cfset tagISBN = rs_book.book_isbn />
											<cfif len(tagISBN) eq 10>
												<cfset tagISBN = mathAdvice.upgradeISBN(tagISBN) />
												,<em><cfoutput>#dictAdvice.getISBN( tagISBN )#</cfoutput></em>
											</cfif>
										</p>
									</cfif>
									<ol>
										<li>作者: <cfoutput>#replace( rs_book.book_authors, "/", ", ", "ALL")#</cfoutput></li>
										<li>出版社 <cfoutput>#rs_book.publisher#</cfoutput> - <cfoutput>#dictAdvice.getBookEdition( rs_book.book_edition, ', ')#</cfoutput></li>
										<li>定价 <strong><cfoutput>#numberFormat( rs_book.book_prise, '____.__')#</cfoutput></strong></li>
									</ol>
								</div>
							</div>
						</div>
						
						<!-- editPlan -->
						<form id="formEditPlan" onSubmit="javascript:return processVerfiyForm('formEditPlan');" class="formWrapper" method="post" action="<cfoutput>#buildURL('bookPlanModifyDo')#</cfoutput>">

							<input name="CourseBookID" type="hidden" value="<cfoutput>#courseBookId#</cfoutput>" />

							<div class="label">
								<span class="req">*</span><b>采购数量</b>
								学生用书
								<input name="ForStudent" type="text" class="typeSmallInt" verification="integer" maxlength="6" value="<cfoutput>#event.getArg('ForStudent', rs_courseBook.plan_student)#</cfoutput>" />
								教师用书
								<input name="ForTeacher" type="text" class="typeTinyInt" verification="integer" maxlength="3" value="<cfoutput>#event.getArg('ForTeacher', rs_courseBook.plan_teacher)#</cfoutput>" />
							</div>
						
							<hr/>

							<div class="label">
								<span class="req">*</span><b>联络人</b>
								<input name="Contract" type="text" class="typeTextTiny" verification="required" maxlength="30" value="<cfoutput>#event.getArg('Contract', rs_courseBook.contract)#</cfoutput>" />
							</div>

							<div class="label">
								<span class="req">*</span><b>联系电话</b>
								<input name="Telephone" type="text" class="typeMobile" verification="required" maxlength="30" value="<cfoutput>#event.getArg('Telephone', rs_courseBook.telephone)#</cfoutput>" />
							</div>
						
							<hr/>
							
							<div class="lable">
								<input class="button" type="submit" value="修改" />
							</div>
						</form>
						
					</div>
				</cfif>
				
				<cfif rs_course.recordCount>
					
					<script language="javascript" type="text/javascript">
						//<![CDATA[
						<!--
						function showBookModify() {
							alert("Add Book");							
						}
						// -->
						//]]>
					</script>
					
					<div id="CourseInfo" class="tabContent">
						
						<div class="noticeBlock">
							<h3><cfoutput>#rs_course.course_name#</cfoutput></h3>
							<p>
								<span class="img icon16x16 message"></span>
								如该课程还需用到其他教材, <a href="javascript:showAddFrom();">可以通过点击这里进行增加</a>. 
							</p>
							<hr/>
						</div>
						
						<div class="UIDashBoard clearfix">
						
							<div class="col2">
								<div class="noticeBlock">
									<p>课程基本信息</p>
									<p>学分 <em><cfoutput>#numberFormat(rs_course.course_credit, "_.__")#</cfoutput></em></p>
									<p>课程学时分布
										<cfif rs_course.period_theory>理论 <em><cfoutput>#rs_course.period_theory#</cfoutput></em></cfif>
										<cfif rs_course.period_practice>实践 <em><cfoutput>#rs_course.period_practice#</cfoutput></em></cfif>
										<cfif rs_course.period_computer>上机 <em><cfoutput>#rs_course.period_computer#</cfoutput></em></cfif>
									</p>
									<ol>
										<li>任课单位: <cfoutput>#rs_course.institute_name#</cfoutput></li>
										<li>类别: <cfoutput>#rs_course.cat_name#</cfoutput></li>
									</ol>
								</div>
							</div>
							
							<div class="col2 last">
								
							</div>
						
						</div>
						
						<div class="noticeBlock">
							<h3>课程教材选用清单</h3>
							<hr/>
						</div>
						<table id="bookList" class="UIEditable">
							<thead>
								<tr>
									<td width="18"></td>
									<td>教材</td>
									<td>书号</td>
									<td>出版社</td>
									<td>版次</td>
									<td>作者</td>
									<td width="18"></td>
								</tr>
							</thead>
							<tbody>
								<cfset row = 0 />
                                <cfloop query="rs_bookForCourse">
									<cfset structInsert(targetArgs, "CID", rs_bookForCourse.cid, true) />
									<cfset structInsert(targetArgs, "BID", rs_bookForCourse.bid, true) />
									<cfset structInsert(targetArgs, "CBID", rs_bookForCourse.cbid, true) />
									<tr class="editRows">
										<cfset row++ />
										<td class="index"><cfoutput>#row#</cfoutput></td>
										<td><cfif rs_bookForCourse.bid neq bookId><a href="<cfoutput>#buildURL('courseBookDetail', targetArgs)#</cfoutput>"></cfif>《<cfoutput>#rs_bookForCourse.book_name#</cfoutput>》<cfif rs_bookForCourse.bid neq bookId></a></cfif></td>
										<td><span class="numeric"><cfif rs_bookForCourse.bid neq bookId><a href="<cfoutput>#buildURL('courseBookDetail', targetArgs)#</cfoutput>"></cfif><cfoutput>#dictAdvice.getISBN( rs_bookForCourse.book_isbn )#</cfoutput><cfif rs_bookForCourse.bid neq bookId></a></cfif></span></td>
										<td><cfoutput>#rs_bookForCourse.publisher#</cfoutput></td>
										<td><cfoutput>#dictAdvice.getBookEdition( rs_bookForCourse.book_edition, '')#</cfoutput></td>
										<td><cfoutput>#replace(rs_bookForCourse.book_authors, "/", ", ", "ALL")#</cfoutput></td>
										<td><cfif rs_bookForCourse.bid eq bookId><span class="stat checked"></span><cfelse><a href="<cfoutput>#buildURL('courseBookDetail', targetArgs)#</cfoutput>" class="stat info"></a></cfif></td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						
						<!-- addPlan -->
						<form id="formAddBook" onSubmit="javascript:return processCreate();" class="formWrapper hidden_elem" method="post" action="<cfoutput>#buildURL('bookPlanAddDo')#</cfoutput>">

							<input name="TermID" type="hidden" value="<cfoutput>#termId#</cfoutput>" />
							<input name="CourseID" type="hidden" value="<cfoutput>#courseId#</cfoutput>" />
							<input name="BookID" id="BookID" type="hidden" value="" />
							
							<div class="label">
								<b>教材</b>
								<input name="BookName" id="BookName" type="text" disabled="disabled" class="typeTextDynamic " verification="required" value="<cfoutput>#event.getArg('BookName','未指定')#</cfoutput>" /><span id="bookTrigger" class="btnSearch"></span>
							</div>
						
							<hr/>

							<div class="label">
								<span class="req">*</span><b>联络人</b>
								<input name="Contract" id="Contract" type="text" class="typeTextTiny" verification="required" maxlength="30" value="<cfoutput>#event.getArg('Contract')#</cfoutput>" />
							</div>

							<div class="label">
								<span class="req">*</span><b>联系电话</b>
								<input name="Telephone" id="Telephone" type="text" class="typeMobile" verification="required" maxlength="30" value="<cfoutput>#event.getArg('Telephone')#</cfoutput>" />
							</div>
						
							<hr/>
						
							<div class="label">
								<span class="req">*</span><b>采购数量</b>
								学生用书
								<input name="ForStudent" id="ForStudent" type="text" class="typeSmallInt" verification="integer" maxlength="6" value="<cfoutput>#event.getArg('ForStudent', rs_courseBook.plan_student)#</cfoutput>" />
								教师用书
								<input name="ForTeacher" id="ForTeacher" type="text" class="typeTinyInt" verification="integer" maxlength="3" value="<cfoutput>#event.getArg('ForTeacher','0')#</cfoutput>" />
							
								<p class="notice">学生用书数量系统会根据选课情况尝试自动统计, 如果尚未完成学生选课 或 新生教材预定, 可以在这里填写计划招生数量.</p>
							</div>
						
							<div class="label">
								<span class="req">*</span><b>价格预算</b>
								定价
								<input name="Prise" id="Prise" type="text" class="typeSmallInt" verification="double" maxlength="7" value="<cfoutput>#event.getArg('Prise','0.00')#</cfoutput>" />
								实际售价
								<input name="Charge" id="Charge" type="text" class="typeSmallInt" verification="double" maxlength="7" value="<cfoutput>#event.getArg('Charge','0.00')#</cfoutput>" />
							
								<div style="width:160px; float:right;">
									折扣率
									<span id="minusDiscount" class="btnMinus">-</span><input name="Discount" id="Discount" type="text" class="typeTinyInt" verification="double" maxlength="4" value="<cfoutput>#event.getArg('Discount','1.00')#</cfoutput>" /><span id="plusDiscount" class="btnPlus">+</span>
								</div>
							
								<p class="notice">此处价格在教材入库时会自动进行更正, 如果无法在入库前确认教材价格, 可以保留为默认值</p>
							</div>
						
							<hr/>
						
							<div class="lable">
								<input class="button" type="submit" value="添加" />
								<input onclick="showAddFrom();" class="button1" type="reset" value="返回" />
							</div>
							
						</form>
						
						<div id="bookBox" class="hidden_elem">
					
							<form id="formSearchBook" class="formWrapper Transparent" method="post">
								<div class="label">
									<b>教材</b>
									<input name="Keywords" id="Keywords" type="text" class="typeText" verification="required" maxlength="128" value="<cfoutput>#event.getArg('Keywords')#</cfoutput>" />
								</div>
								<hr/>
								<div class="lable">
									<input class="button1" type="submit" value="搜索教材" />
									<input id="formSearchBookReset" class="button" type="button" value="返回" />
								</div>
							</form>
						
							<div id="formSearchBookResult"></div>
					
						</div>
						
						<script language="javascript" type="text/javascript">
							//<![CDATA[
							<!--
							function showAddFrom() {
								$("form#formAddBook").toggleClass("hidden_elem");
								$("table#bookList").toggleClass("hidden_elem");
								return void(0);
							}
						
							function processCreate() {
								
								var courseId = $("#CourseID").val();
								var bookId = $("#BookID").val();
							
								if (bookId != "") {
									return processVerfiyForm('formCreate');
								}
								else {
									alert("请先指定课程所使用的教材");
									
									$("form#formAddBook").addClass("hidden_elem");
									$("div#bookBox").removeClass("hidden_elem");
									
									return false;
								}
							}
							
							
							$("span#bookTrigger").click(function(){

								$("form#formAddBook").addClass("hidden_elem");
								$("div#bookBox").removeClass("hidden_elem");
								$("div#planNotice").addClass("hidden_elem");

							});
							
							$("input#formSearchBookReset").click(function(){
								
								$("form#formAddBook").removeClass("hidden_elem");
								$("div#bookBox").addClass("hidden_elem");
								$("div#planNotice").removeClass("hidden_elem");
								
							});
							
							$("#formSearchBook").submit(function(){
							
								if (processVerfiyForm('formSearchBook')) {
								
									$.getJSON(
												'<cfoutput>#buildURL("getBookByKeywords")#</cfoutput>',
												{
													'Keywords': $("form#formSearchBook input#Keywords").val(),
													'seed': (new Date()).getTime()
												},
												function(data) {

													$div = $("div#formSearchBookResult").html("").removeClass("hidden_elem");
												
													book = data.book;
													publisher = data.publisher;

													for (var j=0; j<publisher.length; j++) {
													
														var $element = $("<div class='noticeBlock'><h3>" + publisher[j][1] + "</h3><hr/></div>");
													
														$element.appendTo($div);
													
														$container = $("<div class='clearfix UICardTable'></div>");
													
														for (var i=0; i<book.length; i++) {
														
															if ( book[i][4] == publisher[j][0] ) {
														
																var $element = $("<dl class='col2'><dt><a><em class='subject'></em><dd class='mpls'><h3>" + book[i][1] + "</h3><div>" + book[i][3] + "<span>" + book[i][2].replace(/YYYY/, '').replace(/\./, ' ver.') + "</span></div></dd></a></dt></dl>");
														
																$element
																		.attr({
																				'BookID' : book[i][0],
																				'BookName' : book[i][1],
																				'BookPrice' : book[i][6]
																				})
																		.click(function(){
															
																			var name = $(this).attr('BookName');
																			var id = $(this).attr('BookID');
																			var price = new Number($(this).attr('BookPrice'));
															
																			$("form#formAddBook input#BookID").val(id);
																			$("form#formAddBook input#BookName").val(name + "(" + id + ")");
																			$("form#formAddBook input#Prise").val(price.toFixed(2));
																			$("form#formAddBook input#Charge").val(price.toFixed(2));
															
																			/* backForm */
																			$("#formAddBook").removeClass("hidden_elem");
																			$("#bookBox").addClass("hidden_elem");
																												
																		})
																		.appendTo($container);
															}
														
														}
													
														$container.appendTo($div);
													
													}


												
												});
								
								}
							
								return false;
							});
							
						
							/* plusDiscount 折扣率增加 实际售价降低 */
							$("span#plusDiscount").click(function(){
							
								var discount = parseInt(100*$("input#Discount").val());
								var price = parseInt(100*$("input#Prise").val());
							
								var charge = new Number(price/100);
								var dis = new Number(1);
							
								if ( discount < 95 ) {
									discount = discount + 5;
								
									/* 重新计算折扣率 */
									dis = new Number( discount /100 );
									/* 重新计算价格 */
									charge = new Number( 0.05 + price * discount /10000 );
							
								}
								else {
									discount = 100;
								}

								$("input#Discount").val( dis.toFixed(2) );
								$("input#Charge").val( charge.toFixed(1) );
							
							});
						
						
							/* minusDiscount 折扣率降低 实际售价升高 */
							$("span#minusDiscount").click(function(){

								var discount = parseInt(100*$("input#Discount").val());
								var price = parseInt(100*$("input#Prise").val());
							
								var charge = new Number(0);
								var dis = new Number(0);

								if ( discount > 5 ) {
									discount = discount - 5;
								
									/* 重新计算折扣率 */
									dis = new Number( discount /100 );
									/* 重新计算价格 */
									charge = new Number( 0.05 + price * discount /10000 );
							
								}
								else {
									discount = 0;
								}
							
								$("input#Discount").val( dis.toFixed(2) );
								$("input#Charge").val( charge.toFixed(1) );
							
							});
						
							// -->
							//]]>				
						</script>
						
					</div>
					
				</cfif>
				
				<cfif rs_book.recordCount>
					
					<script language="javascript" type="text/javascript">
						//<![CDATA[
						<!--
						function showCourseAdd() {
							alert("Add Course");							
						}
						// -->
						//]]>
					</script>
					
					<div id="BookInfo" class="tabContent">
						
						<div class="noticeBlock">
							<h3>《<cfoutput>#rs_book.book_name#</cfoutput>》</h3>
							<p>
								<span class="img icon16x16 message"></span>
								如其他课程也需使用该教材, 下方会自动查找以后列表显示. 
							</p>
							<hr/>
						</div>
						
						<div class="UIDashBoard clearfix">
						
							<div class="col2">
								<div class="noticeBlock">
									<p>基本信息</p>
									<cfif mathAdvice.isISBN( rs_book.book_isbn )>
										<p>
											<em><cfoutput>#dictAdvice.getISBN( rs_book.book_isbn )#</cfoutput></em>
											<cfset tagISBN = rs_book.book_isbn />
											<cfif len(tagISBN) eq 10>
												<cfset tagISBN = mathAdvice.upgradeISBN(tagISBN) />
												,<em><cfoutput>#dictAdvice.getISBN( tagISBN )#</cfoutput></em>
											</cfif>
										</p>
									</cfif>
									<ol>
										<li>作者: <cfoutput>#replace( rs_book.book_authors, "/", ", ", "ALL")#</cfoutput></li>
										<li>出版社 <cfoutput>#rs_book.publisher#</cfoutput> - <cfoutput>#dictAdvice.getBookEdition( rs_book.book_edition, ', ')#</cfoutput></li>
										<li>定价 <strong><cfoutput>#numberFormat( rs_book.book_prise, '____.__')#</cfoutput></strong></li>
										<li>库存 <strong><cfoutput>#rs_book.book_stock#</cfoutput></strong> 本</li>
									</ol>
								</div>
								
								<cfif len(rs_book.book_awards)>
									<div class="noticeBlock">
										<p>备注</p>
										<cfoutput>#strAdvice.XHTMLParagraphFormat( rs_book.book_awards )#</cfoutput>
									</div>
								</cfif>
								
							</div>
						
							<div class="col2 last">
								<div class="noticeBlock">
									<cfif mathAdvice.isISBN( rs_book.book_isbn )>
										<h3>印刷品条码</h3>
										<p><span class="img icon16x16 message"></span>该条码用于生成征订数据时, 教材的唯一识别码</p>
										<br/>
										<cfset tagISBN = rs_book.book_isbn />
										<cfif len(tagISBN) eq 10>
											<cfset tagISBN = mathAdvice.upgradeISBN(tagISBN) />
										</cfif>
										<p><img src="<cfoutput>#getContextRoot()#</cfoutput>/barcode/ISBN/<cfoutput>#tagISBN#</cfoutput>.png" /></p>
									</cfif>
								</div>
							</div>
						
						</div>
						
						<cfif rs_courseByBook.recordCount>
							<div class="noticeBlock">
								<h3>同时使用该教材的课程还有</h3>
								<hr/>
							</div>
							<table id="courseList" class="UIEditable">
								<thead>
									<tr>
										<td width="18"></td>
										<td>课程</td>
										<td>学分</td>
										<td>任课单位</td>
										<td>联系人</td>
										<td>联系电话</td>
									</tr>
								</thead>
								<tbody>
									<cfset row = 0 />
                                    <cfloop query="rs_courseByBook">
										<tr class="editRows">
											<cfset row++ />
											<td class="index"><cfoutput>#row#</cfoutput></td>
											<td><cfoutput>#rs_courseByBook.course_name#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#numberFormat(rs_courseByBook.course_credit, '_.__')#</cfoutput></span></td>
											<td><cfoutput>#rs_courseByBook.institute_name#</cfoutput></td>
											<td><cfoutput>#rs_courseByBook.contract#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#rs_courseByBook.telephone#</cfoutput></span></td>
										</tr>
									</cfloop>
								</tbody>
							</table>
						</cfif>

					</div>
				</cfif>
				
				<cfif rs_courseBook.recordCount>

					<div id="PlanDelete" class="tabContent">
						
						<div class="systemNotice">
							<h3><span class="img icon16x16 info"></span>删除教材征订信息</h3>
							<p>注意: 删除注册教材信息的同时, 会同时删除与教材相关的征订计划,库存, 出入库单等数据信息. </p>
					
							<form id="formRemove" class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('bookPlanRemoveDo')#</cfoutput>">
								<input name="CourseBookID" type="hidden" value="<cfoutput>#courseBookId#</cfoutput>" />
								<input name="CourseID" type="hidden" value="<cfoutput>#courseId#</cfoutput>" />
								<div class="lable"><input class="button2" type="submit" value="删除教材" /></div>
							</form>
						</div>
						
					</div>
					
				</cfif>
				
			</div>
		</li>
	</ul>
</div>